﻿using System;

using System.Windows.Forms;
using ConfExpert.Forms.Base;
using ConfExpert.Utility;

namespace ConfExpert.Forms.Araclar
{
    public partial class Brand2Customer : XPopupForm
    {
        public Brand2Customer()
        {
            InitializeComponent();
        }

        BindingSource bs;
        private void Brand2Customer_Load(object sender, EventArgs e)
        {
            bs = new BindingSource(RepositoryManager.dsi, "Brand");
            InitGridView(gridView1, bs);
            gridView1.OptionsBehavior.Editable = false;
            gridView1.BestFitColumns();

            gridView1.DoubleClick += new EventHandler(gridView1_DoubleClick);
        }

        public int CustomerId = 0;
        void gridView1_DoubleClick(object sender, EventArgs e)
        {
            if (gridView1.GetFocusedRowCellValue("CustomerId") != null)
                if (gridView1.GetFocusedRowCellValue("CustomerId") != null)
                {
                    CustomerId = (int)gridView1.GetFocusedRowCellValue("CustomerId");
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                }
        }
    }
}